import request from '../../utils/request'
import { requestString } from '../../utils/request'

export async function query(data) {
    return request(apiPath.zbtim + "/api/tax", {
        method: 'get',
        data
    });
}

export async function save(data) {
    return request(apiPath.zbtim + "/api/tax", {
        method: 'post',
        data
    });
}


export async function update(data) {
    return request(apiPath.zbtim + "/api/tax", {
        method: 'put',
        data
    });
}

export async function get({ id }) {
    return request(apiPath.zbtim + "/api/tax/" + id, {
        method: 'get'
    });
}

export async function remove({ id }) {
    return request(apiPath.zbtim + "/api/tax/" + id, {
        method: 'delete'
    });
}

export async function doInvoice(data) {
    return requestString(apiPath.zbtim + "/api/tax/doInvoice", {
        method: 'put',
        data: data.products
    });
}

export async function recInvoice(data) {
    return requestString(apiPath.zbtim + "/api/tax/recInvoice/" + data.openInvoiceStatus, {
        method: 'put',
        data: data.invoiceItems
    });
}

export async function updateOrder(data) {
    return requestString(apiPath.zbtim + "/api/tax/updateOrder", {
        method: 'put',
        data
    });
}